//
//  PassageCell.m
//  Zhiche-Carriage
//
//  Created by LeeBruce on 16/12/6.
//  Copyright © 2016年 LeeBruce. All rights reserved.
//

#import "PassageCell.h"

@implementation PassageCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self initSubviews];
    }
    
    return self;
}

-(void)initSubviews
{
    
    self.middleImg = [[UIImageView alloc]initWithFrame:CGRectMake(18, (cellH - 10)/2.0, 10, 10)];
    self.middleImg.layer.borderColor = [UIColor redColor].CGColor;
    self.middleImg.layer.cornerRadius = 5;
    self.middleImg.layer.borderWidth = 0.5;
    self.middleImg.layer.masksToBounds = YES;
    [self.contentView addSubview:self.middleImg];
    
    
    self.topLabel = [[UILabel alloc]initWithFrame:CGRectMake(18 + 5, 0, 0.5, (cellH - 10)/2.0)];
    self.topLabel.backgroundColor = fontGrayColor;
    [self.contentView addSubview:self.topLabel];
    
    
    self.bottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(18 + 5, (cellH + 10)/2.0, 0.5, (cellH - 10)/2.0)];
    self.bottomLabel.backgroundColor = fontGrayColor;
    [self.contentView addSubview:self.bottomLabel];
    
    
    self.titleL = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.middleImg.frame) + 20, 0, 300, cellH/2)];
    [self.contentView addSubview:self.titleL];
    self.titleL.font = Font(12);
    self.titleL.textColor = littleBlackColor;
    self.titleL.adjustsFontSizeToFitWidth = YES;
    
    
    self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.middleImg.frame) + 20, CGRectGetMaxY(self.titleL.frame), 300, cellH/2)];

    [self.contentView addSubview:self.timeLabel];
    self.timeLabel.font = Font(12);
    self.timeLabel.textColor = littleBlackColor;
    self.timeLabel.adjustsFontSizeToFitWidth = YES;
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
